Skip to content

ci(helm): roll prereleases on main pushes + manual trigger#3461

Merged
nicktrn merged 4 commits intomainfrom
ci/rolling-helm-prereleases
Apr 28, 2026
Merged

ci(helm): roll prereleases on main pushes + manual trigger#3461
nicktrn merged 4 commits intomainfrom
ci/rolling-helm-prereleases

Conversation

@nicktrn
Copy link
Copy Markdown
Collaborator

@nicktrn nicktrn commented Apr 28, 2026

Today the helm prerelease workflow only fires on PRs that touch hosting/k8s/helm/**. Two consequences we ran into:

  1. The changeset-release/main PR's prerelease comment goes stale once the release branch gets force-pushed without a helm-touching commit (the bot's Chart.yaml bump alone doesn't seem to refire the trigger reliably).
  2. The release PR's chart references an appVersion (e.g. v4.4.5) whose Docker images don't exist until after merge + tag. So that prerelease chart can't actually be installed end-to-end.

Renames the workflow to helm-prerelease.yml and adds two new triggers:

  • push: main with paths: hosting/k8s/helm/** -> rolling prereleases versioned <base>-main.<sha>. appVersion stays at whatever Chart.yaml has (i.e. last released), so installs pull real images. Tests that chart structure is deployable, even if the app code is one release behind.
  • workflow_dispatch with optional app_version input -> manually trigger a prerelease and optionally override appVersion (e.g. pin to main or a specific tag). Useful for testing chart + app-version combinations on demand.

PR behavior unchanged: same <base>-pr<N>.<sha> versioning, same posted/updated comment.

Why not also bypass paths for changeset-release/main? The release PR's chart references not-yet-built v4.4.5 images, so those prereleases aren't actually installable. The rolling main prerelease covers the testable case better.

Why not SHA-pin appVersion to a built image like main-<sha>? Bigger change - the docker publish workflows currently only push :main (no SHA-suffixed tag). Worth doing later if we want first-class "install one chart, get exactly that commit's app code" testing, but out of scope here.

Diff is mostly a rename. Substantive changes:

  • new push and workflow_dispatch triggers
  • prerelease job if: extended for the new event types
  • version logic branches per event
  • new "Override appVersion" step (workflow_dispatch only)
  • new "Write run summary" step so non-PR runs surface the install instructions
  • PR comment steps gated on github.event_name == 'pull_request'
  • concurrency group falls back to github.ref for non-PR runs

Renames helm-pr-prerelease.yml to helm-prerelease.yml. The workflow now
also runs on main pushes (paths: hosting/k8s/helm/**) so the chart
doesn't go stale between releases, and supports workflow_dispatch with
an optional appVersion override for manual builds.

Behavior:
- pull_request: <base>-pr<N>.<sha>, posts/updates a PR comment as before
- push to main: <base>-main.<sha>, summary written to run page
- workflow_dispatch: <base>-<ref-slug>.<sha>, optional appVersion override
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

⚠️ No Changeset found

Latest commit: bcf28dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 7b5e8494-462e-4f1b-9f90-c2bb413fab1d

📥 Commits

Reviewing files that changed from the base of the PR and between 5a9ba0e and bcf28dc.

📒 Files selected for processing (1)
  • .github/workflows/pr_checks.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/pr_checks.yml
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (32)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: typecheck / typecheck
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: lint-and-test
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)

Walkthrough

The .github/workflows/helm-prerelease.yml workflow was extended from pull_request-only to also run on push to main (limited to the Helm chart path) and workflow_dispatch (with optional app_version input). Concurrency grouping now falls back to ${{ github.ref }} when no PR number exists. The prerelease job if condition was broadened to include push and workflow_dispatch; chart version generation was made event-dependent (PR, push, or dispatch formats); manual dispatch can override Chart.yaml appVersion; a run summary with published version and install command was added; and PR comment steps are restricted to pull_request events. The README newline at EOF was fixed. The .github/workflows/pr_checks.yml paths-ignore now includes the Helm prerelease workflow file.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding rolling main pushes and manual trigger capability to the Helm prerelease workflow.
Description check ✅ Passed The description is mostly complete with clear context, rationale, and implementation details, though the template's Testing, Changelog, and Screenshots sections are not formally completed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/rolling-helm-prereleases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

🧭 Helm Chart Prerelease Published

Version: 4.4.4-pr3461.bcf28dc

Install:

helm upgrade --install trigger \
  oci://ghcr.io/triggerdotdev/charts/trigger \
  --version "4.4.4-pr3461.bcf28dc"

⚠️ This is a prerelease for testing. Do not use in production.

nicktrn added 2 commits April 28, 2026 15:32
- override appVersion via yq + env (no sed escape issues for user input)
- fall back REF_SLUG to 'manual' when sanitization strips it empty
- ignore helm prerelease workflow files in pr_checks.yml so unrelated
  CI edits don't trigger the full typecheck/unit/e2e suite
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/helm-prerelease.yml (1)

69-77: ⚠️ Potential issue | 🟠 Major

Restrict PR write token scope to PR-only execution path.

With Line 69-Line 72 allowing push and workflow_dispatch, keeping pull-requests: write at Line 77 gives non-PR runs unnecessary write scope. Split PR commenting into a separate PR-only job (or otherwise isolate permissions) so non-PR runs keep minimal token access.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/helm-prerelease.yml around lines 69 - 77, The workflow
currently grants pull-requests: write unconditionally while the job's if
condition allows push and workflow_dispatch, so restrict write scope by moving
the PR-specific permission into a separate job or conditional job that only runs
for pull_request events; locate the job with the if block and the permissions
stanza and create a PR-only job (or duplicate the existing job) that uses if:
github.event_name == 'pull_request' and sets permissions: pull-requests: write,
while the original job (for push and workflow_dispatch) keeps only minimal
permissions (e.g., contents: read, packages: write) so non-PR runs never receive
pull-requests: write.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/helm-prerelease.yml:
- Around line 69-77: The workflow currently grants pull-requests: write
unconditionally while the job's if condition allows push and workflow_dispatch,
so restrict write scope by moving the PR-specific permission into a separate job
or conditional job that only runs for pull_request events; locate the job with
the if block and the permissions stanza and create a PR-only job (or duplicate
the existing job) that uses if: github.event_name == 'pull_request' and sets
permissions: pull-requests: write, while the original job (for push and
workflow_dispatch) keeps only minimal permissions (e.g., contents: read,
packages: write) so non-PR runs never receive pull-requests: write.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 573a0b15-0e0f-454c-8e41-b061d8f80126

📥 Commits

Reviewing files that changed from the base of the PR and between c44257d and 5a9ba0e.

📒 Files selected for processing (2)
  • .github/workflows/helm-prerelease.yml
  • .github/workflows/pr_checks.yml
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/pr_checks.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (32)
  • GitHub Check: prerelease
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: sdk-compat / Deno Runtime
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: sdk-compat / Node.js 22.12 (ubuntu-latest)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: units / e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: sdk-compat / Bun Runtime
  • GitHub Check: sdk-compat / Node.js 20.20 (ubuntu-latest)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: sdk-compat / Cloudflare Workers
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (python)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 2195
File: .github/workflows/release-helm.yml:42-46
Timestamp: 2025-06-25T13:24:23.836Z
Learning: In .github/workflows/release-helm.yml, the user nicktrn confirmed that using 'entrypoint' with 'docker://' steps works fine, contrary to previous analysis suggesting it's unsupported.
🔇 Additional comments (3)
.github/workflows/helm-prerelease.yml (3)

106-120: Event-specific prerelease versioning logic looks solid.

The PR/push/manual branching is clear, and the empty-slug fallback prevents malformed manual versions.


128-134: appVersion override hardening is a good improvement.

Using yq with strenv(APP_VERSION) avoids the prior shell-escaping pitfalls for manual inputs.


147-160: Good UX split between run summary and PR comments.

Writing $GITHUB_STEP_SUMMARY for all runs and gating PR comments to pull_request keeps non-PR runs informative without noisy PR API calls.

Also applies to: 163-173

@nicktrn nicktrn added the ready label Apr 28, 2026
@nicktrn nicktrn marked this pull request as ready for review April 28, 2026 14:40
@nicktrn
Copy link
Copy Markdown
Collaborator Author

nicktrn commented Apr 28, 2026

ready

@nicktrn nicktrn merged commit fefe61f into main Apr 28, 2026
11 of 42 checks passed
@nicktrn nicktrn deleted the ci/rolling-helm-prereleases branch April 28, 2026 14:42
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

PRERELEASE_VERSION="${BASE_VERSION}-main.${SHORT_SHA}"
else
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
REF_SLUG=$(echo "${{ github.ref_name }}" | tr '/' '-' | tr -cd 'a-zA-Z0-9-')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Script injection via direct interpolation of github.ref_name in shell command

On line 115, ${{ github.ref_name }} is directly interpolated into a run: shell script. GitHub Actions expands ${{ }} expressions before the shell executes, so if the ref name contains shell metacharacters (e.g., backticks, $(), etc.), they will be interpreted by the shell. For example, a branch named test`malicious-command` would execute malicious-command. While this requires write access to the repo (to both create the branch and trigger workflow_dispatch), it's a well-documented GitHub Actions script injection anti-pattern that could allow exfiltration of secrets available in the workflow (e.g., GITHUB_TOKEN with packages: write).

Recommended fix: use an environment variable

Pass github.ref_name via an environment variable so the shell receives it as data rather than code:

env:
  REF_NAME: ${{ github.ref_name }}
run: |
  REF_SLUG=$(echo "$REF_NAME" | tr '/' '-' | tr -cd 'a-zA-Z0-9-')
Prompt for agents
In .github/workflows/helm-prerelease.yml, line 115, the expression ${{ github.ref_name }} is directly interpolated into a shell run: block, which is a script injection vulnerability. GitHub Actions expands the expression before shell execution, so shell metacharacters in branch names (backticks, $(), etc.) would be executed.

The fix is to pass github.ref_name through an environment variable instead of direct interpolation. Change the else block (lines 113-119) to pass REF_NAME as an env var on the step, and reference $REF_NAME in the shell script. Something like:

env:
  REF_NAME: ${{ github.ref_name }}
run: |
  SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
  REF_SLUG=$(echo "$REF_NAME" | tr '/' '-' | tr -cd 'a-zA-Z0-9-')
  ...

Note: github.sha is safe since it's always a hex string, but github.ref_name is user-influenced and needs the env var treatment.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants